﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Core
{
    public static partial class msg
    {
        public static dynamic getDSNoticeList(int start, int limit)
        {
            var sql = new Sql.SqlDataContext();
            var total = sql.DSNotice.Count();
            var result = (from n in sql.DSNotice
                          orderby n.nid descending
                          select new
                          {
                              n.nid,
                              n.title,
                              n.color,
                              time = n.time.toTimeString()
                          }).Skip(start).Take(limit);
            return new
            {
                success = true,
                total,
                result
            };
        }
    }
}
